import request from "@/utils/request";

// 查询材料计划列表
export function listMaterialPlan(query) {
  return request({
    url: "/ma/materialPlan/list",
    method: "get",
    params: query
  });
}

// 查询材料计划详细
export function getMaterialPlan(planId) {
  return request({
    url: "/ma/materialPlan/" + planId,
    method: "get"
  });
}

// 查询材料计划明细
export function getMaterialPlanDetails(planId) {
  return request({
    url: "/ma/materialPlan/getDetails/" + planId,
    method: "get"
  });
}

// 新增材料计划
export function addMaterialPlan(data) {
  return request({
    url: "/ma/materialPlan",
    method: "post",
    data: data
  });
}

// 修改材料计划
export function updateMaterialPlan(data) {
  return request({
    url: "/ma/materialPlan",
    method: "put",
    data: data
  });
}
// 修改材料计划详情
export function updateMaterialPlanDetails(data) {
  return request({
    url: "/ma/materialPlanDetails/updateDetails",
    method: "post",
    data: data
  });
}
// 删除材料计划
export function delMaterialPlan(planId) {
  return request({
    url: "/ma/materialPlan/" + planId,
    method: "delete"
  });
}
